﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
using System.Web.Ria.Data;
using System.Windows.Ria;
using System.Windows.Ria.Services;
using Thor.Common;
using Thor.Domain;

namespace Thor.Domain.Configuration
{
    public partial class Settings : ISettings, IEncryptable
    {
        public void Encrypt()
        {
            if (!IsEncrypted)
            {
                Encryptor encryptor = new Encryptor();
                encryptor.Encrypt(this);
                _isEncrypted = true;
            }
        }

        public void Decrypt()
        {
            if (IsEncrypted)
            {
                Decryptor decryptor = new Decryptor();
                decryptor.Decrypt(this);
                _isEncrypted = false;
            }
        }
    }
}
